package top.yaofengqiao.springcloudsimple.demo.biz.domain.order.repository;

import top.yaofengqiao.springcloudsimple.common.constant.RechargeOrderStatus;
import top.yaofengqiao.springcloudsimple.demo.biz.domain.order.model.entity.OrderEntity;

/**
 * @author yfq
 * @date 2024/6/14 11:33
 * @description
 */
public interface IRechargeOrderRepository {
    long save(OrderEntity order);

    /**
     * 查询未支付订单
     */
    OrderEntity queryUnpaidOrder(String productId, long userId);

    OrderEntity queryByOrderNo(String orderNo);

    OrderEntity queryByOrderId(long orderId);

    boolean updateRechargeOrderByOrderNo(OrderEntity orderEntity, String orderNo);

    boolean changeToPayment(OrderEntity orderEntity);

    void changeStatus(String rechargeOrderNo, RechargeOrderStatus origin, RechargeOrderStatus target);
}
